import request from "../index";

export default class RoleRequest {
  // 获取角色信息
  public static getRole(params) {
    return request({
      url: "/role",
      params,
      method: "get",
    });
  }

  // 创建角色
  public static addRole(data) {
    return request({
      url: "/role",
      data,
      method: "post",
    });
  }

  // 修改角色信息
  public static editRole(data) {
    return request({
      url: "/role",
      data,
      method: "put",
    });
  }

  // 删除角色
  public static deleteRole(params) {
    return request({
      url: "/role",
      params,
      method: "delete",
    });
  }
  // 获取角色列表
  public static getRoleList(params) {
    return request({
      url: "/role/list",
      params,
      method: "get",
    });
  }
  // 获取全部角色
  public static getAllRole(params) {
    return request({
      url: "/role/all",
      params,
      method: "get",
    });
  }
}
